<!DOCTYPE html>
<%@ page pageEncoding="UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>游戏列表</title>
    <base href="${pageContext.request.contextPath}/">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script src="../../../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../../js/xadmin.js"></script>
    <style>
        .layui-table tr td{
            width: 100px;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr style="background: #27d4c9;">
                            <th>序号</th>
                            <th>编号</th>
                            <th>图片</th>
                            <th>游戏名字</th>
                            <th>删除</th>
                            <th>修改</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="game" items="${game}" varStatus="xuan">
                            <%--<c:set var="index" value="1"></c:set>--%>
                        <tr>
                            <td>${xuan.count}</td>
                            <td>${game.id}</td>
                            <td><img src="${initParam.IP}${game.icon}" title="${game.title}"
                                     style="width: 60px;height: 60px"></td>
                            <td>${game.title}</td>
                            <td class="td-manage">
                                <a href="servlet/GameServiceTypeAction?act=delete&id=${game.id}"
                                   class="lafitewu_look" title="查看" onclick="return confirm('确认删除吗?')">
                                    删除
                                </a>
                            </td>
                            <td class="td-manage">
                                <a href="servlet/GameServiceTypeAction?act=update&id=${game.id}"
                                   class="lafitewu_auditing lafitewu_margin_left_20" title="修改">
                                    修改
                                </a>
                                </td>
                        </tr>
                            <%--<c:set var="index" value="${index+1}"></c:set>--%>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
                    <tr>
                        <td colspan="10" >
                            <c:if test="${page != 1}">
                                <a href="servlet/GameServiceTypeAction?act=list&page=1"style="margin-left: 100px">首页</a>
                                <a href="servlet/GameServiceTypeAction?act=list&page=${page-1}">上一页</a>
                            </c:if>
                            <c:if test="${page == 1}">
                                <label style="margin-left: 472px">首页</label>
                                <label>上一页</label>
                            </c:if>
                            <a>第${page}页</a>
                            <c:if test="${page != lastpage}">
                                <a href="servlet/GameServiceTypeAction?act=list&page=${page+1}">下一页</a>
                                <a href="servlet/GameServiceTypeAction?act=list&page=${lastpage}">尾页</a>
                            </c:if>
                            <c:if test="${page == lastpage}">
                                <label>下一页</label>
                                <label>尾页</label>
                            </c:if>
                            <form action="servlet/GameServiceTypeAction?act=list" style="display: inline-block">
                                <input name="page" type="number" style="width: 30px">
                                <input type="submit" value="go">
                            </form>
                        </td>
                    </tr>
            </div>
        </div>
    </div>
</div>
</body>
<script>layui.use(['laydate', 'form'],
    function() {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });
/*用户-删除*/
function member_del(obj, id) {
    layer.confirm('确认要删除吗？',
        function(index) {
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!', {
                icon: 1,
                time: 1000
            });
        });
}

</script>

</html>